<template>
  <div id="app">
    <div class="main">
      <img alt="Vue logo" src="./assets/logo.png">
      <!--
            通过绑定属性的方式来传递Props,
            Props 可以绑定多个 也可以绑定方法 子组件可以调用方法来实现和父组件的交互
            可以通过 v-bind 一次绑定多个
       -->
      <Home v-bind="student" />
      <About :increment="increment" :count="count"/>
    </div>
  </div>
</template>

<script>
import Home from './components/Home.vue'
import About from './components/About.vue'

export default {
  name: 'App',
  components: {
    Home,
    About
  },
  data() {
    return {
      count: 100,
      student: {
        name: '张三',
        age: 18
      }
    }
  },
  methods: {
    increment(n) {
      this.count = n
    }
  }
}
</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
